from abc import ABC, abstractmethod

# Target: 目标接口
class Target(ABC):
    @abstractmethod
    def request(self):
        pass

# Adaptee: 被适配者
class Adaptee:
    def specializedRequest(self):
        print("Adaptee's specialized request")

# Adapter: 适配器
class Adapter(Target):
    def __init__(self, adaptee: Adaptee):
        self._adaptee = adaptee

    def request(self):
        self._adaptee.specializedRequest()

# Client: 客户端
class Client:
    def __init__(self, target: Target):
        self._target = target

    def execute(self):
        self._target.request()

# Usage
if __name__ == "__main__":
    # 创建被适配者
    adaptee = Adaptee()

    # 创建适配器并包装被适配者
    adapter = Adapter(adaptee)

    # 客户端使用适配器
    client = Client(adapter)
    client.execute()

    #
    # 代码实现
    # Adaptee's specialized request
